TFile::Open("cmpMPV.root");

.x ../sep/mean0.C
 //.x tpcmean.C
.ls

gr=XGLUtils::HistToGraph(hh_mpv);
gr->SetMarkerColor(kBlue);
gr->SetLineColor(kBlue);
gr->SetMarkerStyle(22);
gr->SetMarkerSize(1);

//gtpc=XGLUtils::HistToGraph(hhtpc_mpv);
//gtpc->SetLineColor(kGreen);
//gtpc->SetMarkerColor(kGreen);
//gtpc->SetMarkerStyle(33);
//gtpc->SetMarkerSize(1);

hh0_mpvgr->SetTitle("");

//TString ytit="<Q_{chamber}>_{60%}";
//TString ytit="<Q_{track}>";
//
//TString ytit="<Q_{60}>"; 
//
TString ytit="<1/<(1/Q)_{60}>"; 

//TString ytit="<T_{chamber}>"; 
//TString ytit="<T_{track}>"; 

if(ytit.Contains("T")) {    hh0_mpvgr->SetMaximum(0.4); hh0_mpvgr->SetMinimum(-0.2);  } else   {     hh0_mpvgr->SetMaximum(3); hh0_mpvgr->SetMinimum(0.8);   }


hh0_mpvgr->GetYaxis()->SetTitle(ytit+" (a.u.)");
hh0_mpvgr->GetXaxis()->SetTitle("log_{10}#beta#gamma");
hh0_mpvgr->GetXaxis()->SetLimits(-0.5, 4.5);

cc=new TCanvas("cc");
gPad->SetGrid();

hh0_mpvgr->Draw("ap");
hh1_mpvgr->Draw("p");
gr->Draw("p");
//gtpc->Draw("p");

TLegend leg(0.2, 0.7, 0.7, 0.9);
leg->SetFillStyle(0);
leg->SetBorderSize(-1);
leg->AddEntry(hh0_mpvgr, "#mu, TRD dE/dx (cosmic)", "p");
leg->AddEntry(hh1_mpvgr, "#mu, TRD dE/dx+TR (cosmic)", "p");
leg->AddEntry(gr, "p, #pi, e, TRD dE/dx+TR (pp, #sqrt{s}=7 TeV)", "p");
//leg->AddEntry(gtpc, "p, #pi, e, TPC dE/dx (pp, #sqrt{s}=7 TeV)", "p");
leg->Draw();

cc->Print("cmpV0CosMPV.png");
TFile *fout=new TFile("cmpV0CosMPV.root","recreate");
gr->Write();
//gtpc->Write();
hh0_mpvgr->Write();
hh1_mpvgr->Write();
hh_mpv->Write();
leg->Write();
cc->Write();
fout->Save();
fout->Close();

//=========================

delete cc;

TFile::Open("cmpSEP.root");

.x ../sep/sep.C
 //.x tpcsep.C
.ls

gr=XGLUtils::HistToGraph(hh_mpvsep);
gr->SetMarkerColor(kBlue);
gr->SetLineColor(kBlue);
gr->SetMarkerStyle(22);
gr->SetMarkerSize(1);

//gtpc=XGLUtils::HistToGraph(hhtpc_mpvsep);
//gtpc->SetLineColor(kGreen);
//gtpc->SetMarkerColor(kGreen);
//gtpc->SetMarkerStyle(33);
//gtpc->SetMarkerSize(1);

hh0_mpvsepgr->SetTitle("");
hh0_mpvsepgr->GetYaxis()->SetTitle(ytit+" Separation");
hh0_mpvsepgr->GetXaxis()->SetTitle("log_{10}#beta#gamma");
hh0_mpvsepgr->GetXaxis()->SetLimits(-0.5, 4.5);
hh0_mpvsepgr->SetMaximum(ytit.Contains("T")?1:3);
//hh0_mpvsepgr->SetMaximum(ytit.Contains("T")?1:5.5);

cc=new TCanvas("cc");
gPad->SetGrid();

hh0_mpvsepgr->Draw("ap");
hh1_mpvsepgr->Draw("p");
gr->Draw("p");
//gtpc->Draw("p");

TLegend leg(0.2, 0.7, 0.7, 0.9);
leg->SetFillStyle(0);
leg->SetBorderSize(-1);
leg->AddEntry(hh0_mpvsepgr, "#mu, TRD dE/dx (cosmic)", "p");
leg->AddEntry(hh1_mpvsepgr, "#mu, TRD dE/dx+TR (cosmic)", "p");
leg->AddEntry(gr, "p, #pi, e, TRD dE/dx+TR (pp, #sqrt{s}=7 TeV)", "p");
//leg->AddEntry(gtpc, "p, #pi, e, TPC dE/dx (pp, #sqrt{s}=7 TeV)", "p");
leg->Draw();

cc->Print("cmpV0CosSEP.png");
TFile *fout=new TFile("cmpV0CosSEP.root","recreate");
gr->Write();
//gtpc->Write();
hh0_mpvsepgr->Write();
hh1_mpvsepgr->Write();
hh_mpvsep->Write();
leg->Write();
cc->Write();
fout->Save();
fout->Close();
